{% extends "./inc_base.html" %}
{% block style %}
<link href="/static/assets/css/layout-question.css" rel="stylesheet" type="text/css"/>
<link href="/static/assets/css/huanjia/base.css" rel="stylesheet" type="text/css"/>
{% endblock %}
{% block content %}
<section>
    <div class="container">
        <div class="margin-bottom-20 block hj-banner">
            <div class="col-md-8">
                <div class="aui-container-bxo clearfix">
                    <div class="aui-content-sidebar clearfix" id="nav">
                        <div class="aui-menu-title">
                            全部商品分类
                        </div>
                        <div class="aui-content-main">
                            {% for item in spfl %}
                            <div class="aui-content-menu">
                                <div class="aui-content-menu-head">
                                    <div class="aui-content-menu-head-list">
                                        <h2>{{item.title}}</h2>
                                        {% for item2 in item.ycl %}
                                        {% if loop.index<=3 %}
                                        <a>{{item2.title}}</a>
                                        {% endif %}
                                        {% endfor %}
                                        <i class="aui-content-menu-head-list-arrow"></i>
                                    </div>
                                </div>
                                <div class="aui-content-menu-dow aui-ds">
                                    <dl>
                                        <dt>
                                            <span><a href="/{{item.ccpname}}.html" style="color: #000">产成品</a></span>
                                        </dt>
                                        <dd>
                                            {% for item2 in item.ccp %}
                                            <a href="/p/{{item2.id}}.html" class="aui-a-curr">{{item2.title}}</a>
                                            {% endfor %}
                                        </dd>
                                    </dl>
                                    <dl>
                                        <dt>
                                            <span><a href="/{{item.yclname}}.html" style="color: #000">原材料</a></span>
                                        </dt>
                                        <dd>
                                            {% for item2 in item.ycl %}
                                            <a href="/p/{{item2.id}}.html" class="aui-a-curr">{{item2.title}}</a>
                                            {% endfor %}
                                        </dd>
                                    </dl>
                                </div>
                            </div>
                            {% endfor %}
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-md-4">
                {% if controller.is_login %}
                <div></div>
                {%else%}
                <div class="login-body">
                    <h3>用户登录</h3>
                    <div class="row">
                        <div class="col-sm-12">
                            <form role="form" id="home-login" method="post">
                                <div class="form-group">
                                    <input type="text" name="username" class="form-control" placeholder="手机号" required="">
                                </div>
                                <div class="form-group">
                                    <input type="password" name="password" class="form-control" placeholder="密码" required="">
                                </div>
                                <div class="form-group clearfix note">
                                    <a href="/center/public/register" class="pull-left">注册账号</a>
                                    <a href="/contact" class="pull-right">忘记密码?</a>
                                </div>
                                <div class="row">
                                    <div class="col-md-12">
                                        <button class="btn btn-primary" type="submit" style="width: 100%">登录</button>
                                        <a id="login-select" href="/center/public/loginselect" data-toggle="ajaxModal"></a>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
                {%endif%}
            </div>
        </div>
        <div class="row wrap-box">
            <!-- RIGHT -->
            <div class="col-sm-12 margin-top-20">
                <div class="prompt ptcon">
                    <h1>
                        <a class="tit" href="/price_index_scrap" title="更多数据">价格指数</a>
                        <!--<span class="cs-count">昨日超市成交量：<a href="#" title="更多数据"><b><span id="lastDaySuccessTonnage">84426</span>吨</b></a></span>
                        <span class="cs-count">今日超市成交量：<a href="#" title="更多数据"><b><span id="todayOrderTonnage" style="display: inline;">5654</span>吨</b></a></span>
                        <span class="new-time on"><i></i>更新时间：<span id="new_time">05-21 10:35</span></span>-->
                        <div class="more"><a href="/price_index_scrap" title="更多数据">更多数据</a><i></i></div>
                    </h1>
                    <!--<div class="wrap-data col-md-6 padding-20">&lt;!&ndash;成交量走势图&ndash;&gt;
                        <iframe src="http://oa.zoneber.com:90/WebReport/ReportServer?formlet=%5B5927%5D%5B8fde%5D%5B73af%5D%5B5609%5D%2FForm5.frm" height="428px" width="100%"></iframe>
                    </div>-->
                    <div class="wrap-data col-md-12 padding-20"><!--指数走势图-->
                        <iframe src="http://218.24.153.126:8089/WebReport/ReportServer?formlet=HJ%2Fmh%2Fzs.frm" height="428px" width="100%"></iframe>
                    </div>
                </div>
            </div>
            <div class="col-sm-12 margin-top-20">
                <div class="prompt ptcon">
                    <h1>
                        <a class="tit" href="/price_public_scrap" title="更多数据">价格公示</a>
                        <div class="more"><a href="/price_public_scrap" title="更多数据">更多数据</a><i></i></div>
                    </h1>
                    <div class="wrap-data" style="height: 200px">
                        <iframe id="price-index" name="price-index" src="http://218.24.153.126:8089/WebReport/ReportServer?formlet=HJ%2Fmh%2F000_MH_ZSFL.frm" height="428px" width="100%"></iframe>
                    </div>
                </div>
            </div>
            <div class="col-sm-4 margin-top-20">
                <div class="prompt ptcon">
                    <h1>
                        <a class="tit" href="/notice" title="更多数据">网站公告</a>
                        <div class="more"><a href="/notice" title="更多数据">更多数据</a><i></i></div>
                    </h1>
                    <div class="wrap-data panel-body con" style="height: 310px">
                        <ol class="current">
                            {%model data="list1",table="document",where='{"pid":0,"status":1,"category_id":148}',order="level DESC,create_time desc",limit="9",cache="1"%}
                            {% for val in list1 %}
                            <li>
                                <div class="row">
                                    <div class="col-md-9"><span {%if loop.index < 4 %}class="topRank"{%endif%}>{{loop.index}}</span><a target="_blank" href="{{val.name|get_url(val.id)}} " title="{{val.title}}" >{{val.title}}</a></div>
                                    <div class="col-md-3 text-right">{{val.create_time|moment('MM-DD')}}</div>
                                </div>
                            </li>
                            {%endfor%}
                        </ol>
                    </div>
                </div>
            </div>
            <div class="col-sm-4 margin-top-20">
                <div class="prompt ptcon">
                    <h1>
                        <a class="tit" href="/news-0-1" title="更多数据">基层动态</a>
                        <div class="more"><a href="/news-0-1" title="更多数据">更多数据</a><i></i></div>
                    </h1>
                    <div class="wrap-data panel-body con" style="height: 310px">
                        <ol class="current">
                            {%model data="list1",table="document",where='{"pid":0,"status":1,"category_id":1,"group_id":1}',order="level DESC,create_time desc",limit="9",cache="1"%}
                            {% for val in list1 %}
                            <li>
                                <div class="row">
                                    <div class="col-md-9"><span {%if loop.index < 4 %}class="topRank"{%endif%}>{{loop.index}}</span><a target="_blank" href="{{val.name|get_url(val.id)}} " title="{{val.title}}" >{{val.title}}</a></div>
                                    <div class="col-md-3 text-right">{{val.create_time|moment('MM-DD')}}</div>
                                </div>
                            </li>
                            {%endfor%}
                        </ol>
                    </div>
                </div>
            </div>
            <div class="col-sm-4 margin-top-20">
                <div class="prompt ptcon">
                    <h1>
                        <a class="tit" href="/news-0-2" title="更多数据">行业资讯</a>
                        <div class="more"><a href="/news-0-2" title="更多数据">更多数据</a><i></i></div>
                    </h1>
                    <div class="wrap-data panel-body con" style="height: 310px">
                        <ol class="current">
                            {%model data="list2",table="document",where='{"pid":0,"status":1,"category_id":1,"group_id":2}',order="level DESC,create_time desc",limit="9",cache="1"%}
                            {% for val in list2 %}
                            <li>
                                <div class="row">
                                    <div class="col-md-9"><span {%if loop.index < 4 %}class="topRank"{%endif%}>{{loop.index}}</span><a target="_blank" href="{{val.name|get_url(val.id)}} " title="{{val.title}}" >{{val.title}}</a></div>
                                    <div class="col-md-3 text-right">{{val.create_time|moment('MM-DD')}}</div>
                                </div>
                            </li>
                            {%endfor%}
                        </ol>
                    </div>
                </div>
            </div>
        </div>
    </div>

</section>
{% endblock %}
{%block script%}
<script type="text/javascript" src="/static/assets/js/huanjia/home.js"></script>
<script>
  $(document).on('submit', '#home-login', function (e) {
    var data = $(this).serialize();
    $.ajax({
      type: 'POST',
      url: '/center/public/login',
      data: data,
      success: function (msg) {
        if (msg.errno < 0) {
          _toastr(msg.errmsg, 'top-right', 'error', false);
          if (msg.errno == -4) {
            $('#login-select').click();
            //location.assign('/center/public/loginselect');
          }
        } else {
          // $('#ajaxModal').remove();
          location.assign('/center/index');
          // location.reload(true);
        }
      }
    });

    return false;
  });
</script>
{%endblock%}